package com.com.effectivejava.generics.examples;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.logging.Logger;

/**
 * Created by pankaj on 7/19/14.
 */
public class AddT3 {
    static Logger logger = Logger.getLogger(AddT3.class.getName());

    static {
        logger.setParent(Logger.getLogger(AddT3.class.getPackage().getName()));
    }

    static void print(Collection<? extends Number> collection){
        //collection.add(new Integer(4));
        for(Number t: collection){
            logger.info(""+t);
        }
    }

    static void add(Collection<? extends Number> container){
        //container.add(7);
        //container.add(8.8);
        container.add(null);
        //container.add(new Object());
    }


    public static void main(String[] args) {
        List<Integer> s = new ArrayList<Integer>(){{
            add(1);
            add(2);
        }};
        add(s);
        print(s);
    }
}

